// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

// ****************************************************************************
//  avtGEOSFileReader.h
// ****************************************************************************

#ifndef AVT_GEOS_FILE_READER_H
#define AVT_GEOS_FILE_READER_H

#include <avtVTKFileReader.h>
#include <array_ref_ptr.h>

#include <string>
#include <vector>


// ****************************************************************************
//  Class: avtGEOSFileReader
//
//  Purpose:
//      Reads in GEOS files as a plugin to VisIt.
//
//  Programmer: biagas2 -- generated by xml2avt
//  Creation:   Wed Dec 4 14:55:21 PST 2024
//
// ****************************************************************************

class avtGEOSFileReader : public avtVTKFileReader
{
  public:
                   avtGEOSFileReader(const char *, const DBOptionsAttributes *);
    virtual       ~avtGEOSFileReader(); 

    int            GetNTimesteps(void);
    void           GetTimes(std::vector<double> &);

    vtkDataSet    *GetMesh(int, const char *);
    vtkDataArray  *GetVar(int, const char *) ;

    void           FreeUpResources(void) override;  

    void           ActivateTimestep(int ts);

    void           RegisterVariableList(const char*,
                       const std::vector<CharStrRef> &);
    void           PopulateDatabaseMetaData(avtDatabaseMetaData *, int);

    void           ReadInFile(int) override;

  private:
    void          ReadRootFile(void);
    void          ReadTimeStepFile(int ts);

    std::string baseDir; 

    std::vector<double>      timeSteps;
    std::vector<std::string> timeStepFileNames;

    int currentTS;
    bool haveReadRoot;
    bool rootIsPVD;
    std::vector<std::string> registeredVars;
    std::string rootFile;

};


#endif
